import { geoCoordMap } from './coordinateData'

export const convertData = function (data: any[]) {
  const res = []
  for (let i = 0; i < data.length; i++) {
    //geoCoordMap==>北京市: [116.4551, 40.2539]
    //geoCoord==>[116.4551, 40.2539]
    //value==>[116.4551, 40.2539,xxx]
    const geoCoord = geoCoordMap[data[i].name]
    if (geoCoord) {
      res.push({
        name: data[i].name,
        value: geoCoord.concat(data[i].value)
      })
    }
  }
  return res
}
